<?php

namespace app\Http\Controllers\Home;

use App\Http\Controllers\Controller;
use App\Model\Admin;
use Illuminate\Support\Facades\Redis;

/**
 * Created by PhpStorm.
 * User: tianleilei
 * Date: 2017/7/3
 * Time: 15:49
 */
class Index extends Controller
{

    public function index()
    {
        return Admin::where('id', 100)->where('post_id', '14')->get();

    }

    public function del($id)
    {
        if (!intval($id)) {
            throw new \Exception('页面不存在');
        }

        $res = Admin::destroy($id);
        if ($res) {
            dd('success');
        }
    }

    public function redis()
    {

        dd(exec("python D:\\python\\test.py"));
        dispatch(new \App\Jobs\User());
    }
    public function test($id)
    {
        echo $id;
    }

}
